package com.jie.controller;



import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jie.dto.HealthInfoDTO;
import com.jie.entity.BodyDimension;
import com.jie.entity.HealthInfo;
import com.jie.response.RespBean;
import com.jie.service.IBodyDimensionService;
import com.jie.service.IHealthInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户健康数据信息表 前端控制器
 * </p>
 *
 * @author jie
 * @since 2024-04-20
 */
@RestController
@RequestMapping("/health")
@Api(tags = "用户健康数据模块")
public class HealthInfoController {
    @Autowired
    private IHealthInfoService iHealthInfoService;
    @Autowired
    private IBodyDimensionService iBodyDimensionService;
    //这里要对手环SDK进行绑定所以待定
    @ApiOperation("根据用户id获取当前用户的健康信息")
    @GetMapping("/getUserHealthInfo/{userId}")
    public RespBean<?> getUserHealthInfo(@PathVariable("userId") Integer userId){
        HealthInfoDTO userHealthInfoAndBodyInfo=iHealthInfoService.selectUserHeadlthById(userId);
        return RespBean.success("用户信息：",userHealthInfoAndBodyInfo);
    }
    @ApiOperation("根据小米手环来进行当前用户的健康信息")
    @PostMapping("/todo/updateUserHealthInfo")
    public RespBean<?> updateUserHealthInfo(){
        //更新信息
        return RespBean.success("接口未完成，要对接手环");
    }

}

